package dk.flashnotes.fff.logger {

	/**
	 * @author jk
	 */
	public class FFFLogger {

		private static var _oFFFLogRouter : IFFFLogRouter = DefaultTraceLogRouter.get_oInstance();

		public static function get oFFFLogRouter() : IFFFLogRouter {
			return _oFFFLogRouter;
		}
		
		public static function set oFFFLogRouter(oFFFLogRouter : IFFFLogRouter) : void {
			_oFFFLogRouter = oFFFLogRouter;
		}
		
		public static function info(sMessage : String, ...logObjs) : void {
			call(_oFFFLogRouter.info, sMessage)
		}

		public static function warn(sMessage : String, ...logObjs) : void {
			_oFFFLogRouter.warn(sMessage, logObjs);
		}
		
		public static function error(sMessage : String, ...logObjs) : void {
			_oFFFLogRouter.error(sMessage, logObjs);
		}

		public static function debug(sMessage : String, ...logObjs) : void {
			_oFFFLogRouter.debug(sMessage, logObjs);
		}
		
		public static function call(fFunction:Function, ... args):void {
			//TODO: implement call functions in logger
			var fProxy:Function = function():void {
					fFunction.apply(_oFFFLogRouter, args);
			};
			fProxy();
		}
	}
}
